package com.innerex.inexclear.core.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.innerex.inexclear.core.dao.ClearingRuleDao;
import com.innerex.inexclear.core.model.ClearingRule;
import com.innerex.inexclear.core.service.ClearingRuleManager;

@Service("clearingRuleManager")
public class ClearingRuleManagerImpl extends
		GenericManagerImpl<ClearingRule, Long> implements ClearingRuleManager {

	ClearingRuleDao clearingRuleDao;

	@Autowired
	public ClearingRuleManagerImpl(ClearingRuleDao clearingRuleDao) {
		super(clearingRuleDao);
		this.clearingRuleDao = clearingRuleDao;
	}

	public List<ClearingRule> getClearingRules() {
		return clearingRuleDao.getAllDistinct();
	}

	public ClearingRule saveClearingRule(ClearingRule clearingRule) {
		// TODO perform some checks
		return clearingRuleDao.save(clearingRule);
	}
}